package com.liebaut.config;

import com.liebaut.exception.RestException;
import org.springframework.http.ResponseEntity;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;

public class RestExceptionHandler extends ResponseEntityExceptionHandler {
    @org.springframework.web.bind.annotation.ExceptionHandler({RestException.class})
    public ResponseEntity<String> handleRestException(RestException e) {
        return new ResponseEntity<String>(e.getMessage(), e.getStatus());
    }
}
